Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[simd/v3i]: Implement v128 integer basic arithmetic instructions #121

Merged
merged 5 commits into from
Oct 17, 2023

Conversation

haoyu-zc
Copy link
Contributor

No description provided.

@haoyu-zc
Copy link
Contributor Author

Tested by:

make v3i -j && bin/spectest.v3i -tk test/regress/simd/simd_i64x2_arith.bin.wast
make v3i -j && bin/spectest.v3i -tk test/regress/simd/simd_i32x4_arith.bin.wast
make v3i -j && bin/spectest.v3i -tk test/regress/simd/simd_i16x8_arith.bin.wast
make v3i -j && bin/spectest.v3i -tk test/regress/simd/simd_i8x16_arith.bin.wast

return ((u64.view(r3) << 48) | (u64.view(r2) << 32) | (u64.view(r1) << 16) | r0,
(u64.view(r7) << 48) | (u64.view(r6) << 32) | (u64.view(r5) << 16) | r4);
}
private def do_vv_v_x16(a: (u64, u64), b: (u64, u64), f: (u8, u8) -> u8) -> (u64, u64) { // Performs a 16-lane binop
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably more efficient to just do a loop for this one.

src/engine/V3Eval.v3 Show resolved Hide resolved
@haoyu-zc
Copy link
Contributor Author

Refactored the code to use loops for computations with >8 lanes

@haoyu-zc haoyu-zc requested a review from titzer October 16, 2023 19:04
src/engine/V3Eval.v3 Outdated Show resolved Hide resolved
src/engine/V3Eval.v3 Outdated Show resolved Hide resolved
@haoyu-zc
Copy link
Contributor Author

Removed unnecessary locals. Renamed result0 and result1 to low and high

Copy link
Owner

@titzer titzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@titzer titzer merged commit f6ea019 into titzer:master Oct 17, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants